package cn.wolfcode.education.web.controller;

import cn.wolfcode.education.anno.PermissionName;
import cn.wolfcode.education.query.TransferHistoryQuery;
import cn.wolfcode.education.service.ITransferHistoryService;
import cn.wolfcode.education.util.PageResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/transferHistory")
public class TransferHistoryController {
    @Autowired
    private ITransferHistoryService transferHistoryService;


    @RequiresPermissions("transferHistory:view")
    @PermissionName("移交历史主页")
    @RequestMapping("")
    public String list() {
        return "transferHistory";
    }

    @RequiresPermissions("transferHistory:query")
    @PermissionName("移交历史列表")
    @RequestMapping("query")
    @ResponseBody
    public PageResult query(@ModelAttribute("qo") TransferHistoryQuery qo) {
        return transferHistoryService.query(qo);
    }
}
